package com.sytech.power_bank.helper

import java.util.*

/**
 * Created by li on 2017/7/15.
 */
private fun digits(`val`: Long, digits: Int): String {
    val hi = 1L shl digits * 4
    return java.lang.Long.toHexString(hi or (`val` and hi - 1)).substring(1)
}
fun UUID.shorString():String{
    return digits(this.mostSignificantBits shr 32, 8) +
            digits(this.mostSignificantBits shr 16, 4) +
            digits(this.mostSignificantBits, 4) +
            digits(this.mostSignificantBits shr 48, 4) +
            digits(this.mostSignificantBits, 12)
}